package com.github.ghsea.sso.client.security.shiro;

import java.io.Serializable;
import java.util.UUID;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.SessionIdGenerator;
import org.springframework.stereotype.Component;

/**
 * @author guhai
 */
@Component
public class UUIDSessionIdGenerator implements SessionIdGenerator {

    @Override
    public Serializable generateId(Session session) {
        return UUID.randomUUID().toString().
                replaceAll("-", "");
    }

}
